package com.demo.server;

import java.util.List;
import java.util.Map;

import com.demo.dao.IBbsDao;
import com.demo.entity.Bbs;
import com.demo.entity.base.Page;
import com.demo.web.base.BaseResult;
import com.jweb.annotaion.JAutowired;

public class BbsServer {

	@JAutowired
	public IBbsDao dao;

	public BaseResult<Map<String, String>> listBbs(int currentPage, int type, int order) {
		Page pg = new Page(20, currentPage);
		List<Map<String, String>> resultList = dao.listBbs(type, order, pg);
		int allCounts = dao.getBbsCount(type, order);
		BaseResult<Map<String, String>> basepage = new BaseResult<Map<String, String>>(pg, allCounts);
		basepage.setResultList(resultList);
		return basepage;
	}

	/**获取bbs板块*/
	public List<Map<String, String>> listBbsType() {
		return dao.listBbsType();
	}

}
